
<template>
	<div class="index">
		<div class="center">
			<left></left>
			<div class="right">
          <top></top>
          <div class="hei10"></div>
          <div class="where" style="background: #fff; padding: 10px 30px; font-size: 14px; color: #595959;">
			  当前位置：
			  <router-link to="/index" style="color: #409eff;">分销后台</router-link>>
			  <router-link to="/productionBasismanag" style="color: #409eff;">产品渠道管理</router-link>>
			  新增产品（渠道）
			</div>
          <div class="hei10"></div>
<div class="addpro">
					<div class="step" v-if="allshow">
						<el-steps :active="1" align-center>
							<el-step title="定义基础产品信息" description="设置分类、定制生产规则"></el-step>
							<el-step title="定义销售页信息" description="对外宣传销售话术"></el-step>
							<el-step title="设定佣金及分销商可见" description="设置那些分销商可以销售，给多少佣金"></el-step>
							<el-step title="确认发布" description="上线销售发展用户"></el-step>
						</el-steps>
					</div>
					<div class="step">

						<div class="tilte ">
              <div>定义基础产品信息</div>
							<el-tooltip class="item" effect="light" content="基础信息不对外展示，仅商铺内部可见" placement="top">
								<i class="el-icon-question" style="color: #409EFF; font-size: 25px;"></i>
							</el-tooltip>
						</div>
						<div class="con">
							<el-form ref="form" :rules="rules" @submit.native.prevent :model="form" label-width="120px">
								<div class="flex w330">
									<el-form-item label="运营商:" prop="operator">
										<el-select v-model="form.operator" placeholder="请选择运营商:">
											<el-option v-for="item in sanlist" :key="item.id" :label="item.name"
												:value="item.id"></el-option>
										</el-select>
									</el-form-item>
									<el-form-item label="产品类型:">
										<el-select v-model="form.plan_type_id" placeholder="请选择产品类型:">
											<el-option v-for="item in typelist" :key="item.id" :label="item.name"
												:value="item.id"></el-option>
										</el-select>
										<el-button type="primary" @click="taglog = true" >自定义</el-button>
									</el-form-item>
								</div>
								<div class="flex w330" style="align-items: center;">
									<el-form-item label="产品名称:" prop="name">
										<el-input v-model="form.name" :class="{redbor:!sub1}"
											@input="nijiushiwodeweiyi1" placeholder="产品名称"></el-input>
									</el-form-item>
									<el-form-item label="产品编号:" prop="sku">
										<el-input v-model="form.sku" :class="{redbor:!sub2}" placeholder="产品编号"
											@input="nijiushiwodeweiyi2"></el-input>
									</el-form-item>

                  <div style="margin-bottom: 20px;">
                    <el-checkbox style="margin-left: 20px; margin-right: 10px;" v-model="form.is_force_recharge" :true-label="1" :false-label="0">强充产品</el-checkbox>
                    <el-tooltip class="item" effect="light"
                    	content="该产品必须充值才能激活，勾选后该产品的激活状态“已激活”自动变更为“激活且充值”。" placement="top">
                    	<i class="el-icon-question" style="color: #409EFF; font-size: 20px;"></i>
                    </el-tooltip>
                  </div>

								</div>
								<div class="flex w330">
									<!-- <el-form-item class="w330" label="归属地:" prop="address_city">
										<el-cascader @change="changeaddress" v-model="form.citys" :options="citylist"></el-cascader>
									</el-form-item> -->
                  <el-form-item class="w330" label="归属地:" prop="address_city">
                  	<el-cascader @change="changeaddress"  :checkStrictly="true" :props="{ checkStrictly: true }"  v-model="form.citys" :options="citylist"></el-cascader>
                  </el-form-item>
									<el-form-item label="所属渠道:">

								    <div class="kflexc">
								      <!-- <el-input v-model="form.product_source" style="width: auto;"></el-input> -->
								      <el-select v-model="form.product_source"  clearable filterable placeholder="请选所属渠道:">
								          <el-option v-for="(item,index) in qudaolists" :key="index" :label="item" :value="item"></el-option>
								      </el-select>
								      <el-button type="primary" @click="goopen('productionBasismanag/qudaoguanli')" style="margin-left: 5px;">所属渠道管理</el-button>
								    </div>
									</el-form-item>
								</div>


								<el-form-item label="生产定义:" prop="real_name_type">
									<div class="ori ori3">


										<el-form-item label="是否需要身份证号码:">
											<el-radio-group v-model="form.need_num">
												<el-radio label="0">不需要</el-radio>
												<el-radio label="1">需要</el-radio>
											</el-radio-group>
											<el-tooltip class="item" effect="light"
												content="下单是否需要身份证号码，选择后订单必须有身份证号才会进入审核生产。" placement="top">
												<i class="el-icon-question"></i>
											</el-tooltip>

											<span class="zengzhi">
												<el-checkbox v-model="shoufei2" @change="shoufeichange()">国政通校验(收费)
												</el-checkbox>
												<el-tooltip class="item" effect="light"
													content="会自动审核用户身份证号是否通过国政通验证,该项为增值收费项目0.2元/次" placement="top">
													<i class="el-icon-question"></i>
												</el-tooltip>
											</span>
											<!-- <span class="zengzhi" style="margin-left: 0;">
												<el-checkbox v-model="shoufei3" @change="shoufeichange()">联通开卡校验(收费)
												</el-checkbox>
												<el-tooltip class="item" effect="light"
													content="自动检查用户是否存在一证五户、黑名单问题,该项为增值收费项目0.1元/次" placement="top">
													<i class="el-icon-question"></i>
												</el-tooltip>
											</span> -->
										</el-form-item>
										<el-form-item label="是否需要身份证照片:">
											<el-radio-group v-model="form.real_name_type">
												<el-radio label="1">不需要</el-radio>
												<el-radio label="0">需要</el-radio>
												<el-radio label="3">需要照片但不审核</el-radio>
											</el-radio-group>
											<el-tooltip class="item" effect="light"
												content="下单是否需要三张身份证照片，选择后订单必须有照片才会进入审核生产。" placement="top">
												<i class="el-icon-question"></i>
											</el-tooltip>
											<span class="zengzhi">
												<el-checkbox v-model="shoufei1" @change="shoufeichange()">使用智能照片审核(收费)
												</el-checkbox>
												<el-tooltip class="item" effect="light" content="系统自动识别身份证照片，并将识别的身份证号与订单中的身份证号对照，通过的自动过审。
                        注：对于照片有比例要求、大小要求的、请勿使用该功能。" placement="top">
													<i class="el-icon-question"></i>
												</el-tooltip>
											</span>
										</el-form-item>
										<el-form-item label="生产地址:">
											<el-input v-model="form.produce_address" placeholder="生产地址"></el-input>
										</el-form-item>
									</div>
								</el-form-item>
								<el-form-item label="限制条件:">
									<div class="ori kflex">
                    <div>
                      <el-radio v-model="form.warn_area_type" label="1"
                      	style="display: block; margin-bottom: 20px; padding-left: 40px; margin-right: 10px;">
                      	<span style=" margin-right: 10px;">不发货地址:</span>
                      	<el-button type="primary" size="mini" plain @click="keylog = true">
                      		已设置{{mingan.citys.length}}个</el-button>
                      </el-radio>
                      <el-radio v-model="form.warn_area_type" label="2"
                      	style="display: block; margin-bottom: 20px; padding-left: 40px;">
                      	<span style=" margin-right: 10px;">只发货地址:</span>
                      	<el-select v-model="form.deliver_province" clearable multiple collapse-tags
                      		placeholder="请选择省份:">
                      		<el-option label="北京市" value="北京市"></el-option>
                      		<el-option label="天津市" value="天津市"></el-option>
                      		<el-option label="河北省" value="河北省"></el-option>
                      		<el-option label="山西省" value="山西省"></el-option>
                      		<el-option label="内蒙古自治区" value="内蒙古自治区"></el-option>
                      		<el-option label="吉林省" value="吉林省"></el-option>
                      		<el-option label="黑龙江省" value="黑龙江省"></el-option>
                      		<el-option label="上海市" value="上海市"></el-option>
                      		<el-option label="江苏省" value="江苏省"></el-option>
                      		<el-option label="浙江省" value="浙江省"></el-option>
                      		<el-option label="辽宁省" value="辽宁省"></el-option>
                      		<el-option label="安徽省" value="安徽省"></el-option>
                      		<el-option label="福建省" value="福建省"></el-option>
                      		<el-option label="江西省" value="江西省"></el-option>
                      		<el-option label="山东省" value="山东省"></el-option>
                      		<el-option label="河南省" value="河南省"></el-option>
                      		<el-option label="湖北省" value="湖北省"></el-option>
                      		<el-option label="湖南省" value="湖南省"></el-option>
                      		<el-option label="广东省" value="广东省"></el-option>
                      		<el-option label="广西壮族自治区" value="广西壮族自治区"></el-option>
                      		<el-option label="海南省" value="海南省"></el-option>
                      		<el-option label="重庆市" value="重庆市"></el-option>
                      		<el-option label="四川省" value="四川省"></el-option>
                      		<el-option label="贵州省" value="贵州省"></el-option>
                      		<el-option label="云南省" value="云南省"></el-option>
                      		<el-option label="西藏自治区" value="西藏自治区"></el-option>
                      		<el-option label="陕西省" value="陕西省"></el-option>
                      		<el-option label="甘肃省" value="甘肃省"></el-option>
                      		<el-option label="青海省" value="青海省"></el-option>
                      		<el-option label="宁夏回族自治区" value="宁夏回族自治区"></el-option>
                      		<el-option label="新疆维吾尔自治区" value="新疆维吾尔自治区"></el-option>
                      		<el-option label="台湾省" value="台湾省"></el-option>
                      		<el-option label="香港特别行政区" value="香港特别行政区"></el-option>
                      		<el-option label="澳门特别行政区" value="澳门特别行政区"></el-option>
                      	</el-select>
                      </el-radio>
                      <div style="margin-bottom: 10px;color: #606266;">
                      	<el-checkbox :true-label="1" :false-label="0" v-model="form.is_identify_id"	 style="margin-right: 0;margin-left: 40px;" ></el-checkbox>
                      	按身份证号前4或6位限制
                      	<el-button @click="idcardshow" style="margin-left:10px" type="primary" size="mini" plain >
                      		已设置{{tagssure.length}}个</el-button>
                      </div>
                    </div>
                    <chanpindiqutongbu ref="chanpindiqutongbu" @yinyongall="yinyongall" @shuaxin="shuaxin" v-if="relo" :deliver_province="form.deliver_province" :warn_city="mingan.fixcitys" :warn_province="mingan.citys" :warn_area_type="form.warn_area_type"></chanpindiqutongbu>


                    </div>
                    </el-form-item>
                    <el-form-item label="">
                    	<div class="ori">
										<el-form-item class="age" label="年龄限制(周岁):">
											<el-input v-model="form.min_age" placeholder="最小年龄"></el-input>
											——
											<el-input v-model="form.max_age" placeholder="最大年龄"></el-input>
										</el-form-item>

										<div class="xiaoming">
											<el-form-item label="单人开卡数量限制:">
												<el-select v-model="form.max_purchase" placeholder="请选择最大开卡数量:">
													<el-option label="不限制" value="-1"></el-option>
													<el-option label="1" value="1"></el-option>
													<el-option label="2" value="2"></el-option>
													<el-option label="3" value="3"></el-option>
													<el-option label="4" value="4"></el-option>
													<el-option label="5" value="5"></el-option>
												</el-select>
											</el-form-item>

											<!-- 小鸣莺专用 -->
											<el-form-item label="检测周期:">
												<el-select v-model="xiaomingtime" placeholder="检测周期:">
													<el-option label="不限制" value="0"></el-option>
													<el-option label="1个月" value="1"></el-option>
													<el-option label="2个月" value="2"></el-option>
													<el-option label="3个月" value="3"></el-option>
													<el-option label="4个月" value="4"></el-option>
													<el-option label="5个月" value="5"></el-option>
													<el-option label="6个月" value="6"></el-option>
													<el-option label="7个月" value="7"></el-option>
													<el-option label="8个月" value="8"></el-option>
													<el-option label="9个月" value="9"></el-option>
													<el-option label="10个月" value="10"></el-option>
													<el-option label="11个月" value="11"></el-option>
													<el-option label="12个月" value="12"></el-option>
												</el-select>
											</el-form-item>
										</div>

									</div>
								</el-form-item>
								<!-- 风险预警设置 -->
								<el-form-item label="风险预警设置:">
									<div class="ori" v-loading="fxloading">
										<div class="fx">
											<div :class="fxs.type == 0 ? 'fxli fxact' : 'fxli' " @click="changetype(0)">
												使用全局默认方案</div>
											<div :class="fxs.type == 1 ? 'fxli fxact' : 'fxli' " @click="changetype(1)">
												使用自定义方案</div>
										</div>
										<div class="xiaoming ">
											<el-form-item label="一证五户检测：">
												<el-select v-model="fxs.id_card" :disabled="fx">
													<el-option label="不检测" value="0"></el-option>
													<el-option label="检测" value="1"></el-option>
												</el-select>
											</el-form-item>
											<el-form-item label="检测周期：">
												<el-select v-model="fxs.id_card_range" :disabled="fx">
													<el-option label="不限制" value="9999"></el-option>
													<el-option label="最近30天" value="30"></el-option>
													<el-option label="最近60天" value="60"></el-option>
													<el-option label="最近90天" value="90"></el-option>
													<el-option label="最近120天" value="120"></el-option>
													<el-option label="最近150天" value="150"></el-option>
													<el-option label="最近180天" value="180"></el-option>
												</el-select>
											</el-form-item>

										</div>
										<div class="xiaoming san">
                      <el-form-item label="检测范围：">
                      	<el-select v-model="fxs.sitmobile" :disabled="fx">
                      		<el-option label="本店铺" value="0"></el-option>
                      		<el-option label="系统全部店铺" value="1"></el-option>
                      		<el-option label="本产品" value="2"></el-option>
                      	</el-select>
                      </el-form-item>
											<el-form-item label="联系电话重复：">
												<el-input v-model="fxs.address_mobile" :disabled="fx"
													placeholder="输入上限数值"></el-input>
											</el-form-item>
											<el-form-item label="检测周期：">
												<el-select v-model="fxs.address_mobile_range" :disabled="fx">
													<el-option label="不限制" value="9999"></el-option>
													<el-option label="最近30天" value="30"></el-option>
													<el-option label="最近60天" value="60"></el-option>
													<el-option label="最近90天" value="90"></el-option>
													<el-option label="最近120天" value="120"></el-option>
													<el-option label="最近150天" value="150"></el-option>
													<el-option label="最近180天" value="180"></el-option>
												</el-select>
											</el-form-item>
										</div>
										<div class="xiaoming san">
                      <el-form-item label="检测范围：">
                      	<el-select v-model="fxs.sitaddress" :disabled="fx">
                      		<el-option label="本店铺" value="0"></el-option>
                      		<el-option label="系统全部店铺" value="1"></el-option>
                      		<el-option label="本产品" value="2"></el-option>
                      	</el-select>
                      </el-form-item>
											<el-form-item label="收货地址重复：">
												<el-input v-model="fxs.address" :disabled="fx" placeholder="输入上限数值">
												</el-input>
											</el-form-item>
											<el-form-item label="检测周期：">
												<el-select v-model="fxs.address_range" :disabled="fx">
													<el-option label="不限制" value="9999"></el-option>
													<el-option label="最近30天" value="30"></el-option>
													<el-option label="最近60天" value="60"></el-option>
													<el-option label="最近90天" value="90"></el-option>
													<el-option label="最近120天" value="120"></el-option>
													<el-option label="最近150天" value="150"></el-option>
													<el-option label="最近180天" value="180"></el-option>
												</el-select>
											</el-form-item>
										</div>
                    <div class="xiaoming san">
                      <el-form-item label="检测范围：">
                      	<el-select v-model="fxs.sitidcardnum" :disabled="fx">
                      		<el-option label="本店铺" value="0"></el-option>
                      		<el-option label="系统全部店铺" value="1"></el-option>
                      		<el-option label="本产品" value="2"></el-option>
                      	</el-select>
                      </el-form-item>
                    	<el-form-item label="身份证号码重复：">
                    		<el-input v-model="fxs.id_card_num" :disabled="fx" placeholder="输入上限数值">
                    		</el-input>
                    	</el-form-item>
                    	<el-form-item label="检测周期：">
                    		<el-select v-model="fxs.id_card_num_range" :disabled="fx">
                    			<el-option label="不限制" value="9999"></el-option>
                    			<el-option label="最近30天" value="30"></el-option>
                    			<el-option label="最近60天" value="60"></el-option>
                    			<el-option label="最近90天" value="90"></el-option>
                    			<el-option label="最近120天" value="120"></el-option>
                    			<el-option label="最近150天" value="150"></el-option>
                    			<el-option label="最近180天" value="180"></el-option>
                    		</el-select>
                    	</el-form-item>
                    </div>
										<div class="fxbtm">
											<div v-if="fx">
												<el-button type="primary" @click="fx = false">修改默认方案
												</el-button>
											</div>
											<div v-if="!fx&&fxs.type==0">
												<el-button type="primary" @click="savefx">保存默认方案
												</el-button>
												<el-button type="primary" @click="fx = true">取消修改默认方案
												</el-button>
											</div>
											<div v-if="!fx&&fxs.type==1">
												<el-button type="primary" v-if="fxs.id == ''"
													@click="savefx">保存自定义</el-button>
												<el-button type="primary" v-if="fxs.id != ''"
													@click="fixfx">保存修改</el-button>
											</div>
											<div class="red">注：修改默认方案会导致使用默认方案的所有基础产品风控规则变更</div>
										</div>
									</div>
								</el-form-item>

								<div class="flex">
									<el-form-item label="黑名单:" class="kucunset">
										<el-checkbox v-model="white_list">电信诈骗黑名单用户自动过滤</el-checkbox>
									</el-form-item>
								</div>
								<div class="flex">
									<el-form-item label="设置库存:" class="kucunset">
										<el-select v-model="is_stock" placeholder="请选择" @change="changekucun">
											<el-option label="不限制" value="0"></el-option>
											<el-option label="设置库存" value="1"></el-option>
										</el-select>
									</el-form-item>
									<div class="kucuninp" v-if="kucuninp">
										<el-input v-model="stock" placeholder="输入数量"></el-input>
									</div>
									<el-form-item label="库存报警:" v-if="kucuninp">
										<el-input v-model="warn_stock" placeholder="输入数量"></el-input>
									</el-form-item>
								</div>

								<el-form-item label="生产备注:">
									<el-input style="width: 550px;" v-model="form.produce_remark" placeholder="生产备注">
									</el-input>
								</el-form-item>

                <!-- //新 -->
                <el-form-item class="w480"  label="结算规则:">
                  <div class="kflexc">
                    <el-input v-model="form.commission_rule" style="width: 480px !important;" placeholder="结算规则"></el-input>
                    <div v-if="form.commission_rule_change_at" style="color: #595959; margin-left: 10px;">已配置</div>
                    <div v-if="form.commission_rule_change_at" style="color: #409eff; margin-left: 10px;" @click="jiesuanguizelog = true">修改</div>
                    <div v-if="!form.commission_rule_change_at" style="color: #409eff; margin-left: 10px;" @click="jiesuanguizelog = true">定时生效</div>
                  </div>
                </el-form-item>

                <el-dialog title="结算规则定时生效" :visible.sync="jiesuanguizelog" width="480px"  :close-on-click-modal="false" :close-on-press-escape="false">
                    <div>
                      <el-input v-model="form.change_commission_rule"  placeholder="结算规则生效内容"></el-input>
                    </div>
                    <div>
                      <el-date-picker type="datetime" v-model="form.commission_rule_change_at" size="medium" value-format="yyyy-MM-dd HH:mm:ss" style="margin-bottom: 20px; width: 100%; margin-top: 20px;" placeholder="结算规则生效时间"></el-date-picker>
                    </div>
                    <span slot="footer" class="dialog-footer">
                      <el-button @click="jiesuanguizeqingchu">清除设置</el-button>
                      <el-button type="primary" @click="jiesuanguizelog = false">确 定</el-button>
                    </span>
                </el-dialog>

                <el-form-item class="w480"  label="预估收益:">
                  <div class="kflexc">
                    <el-input v-model="form.expect_income" style="width: 480px !important;" placeholder="预估收益"></el-input>
                    <div v-if="form.expect_income_change_at" style="color: #595959; margin-left: 10px;">已配置</div>
                    <div v-if="form.expect_income_change_at" style="color: #409eff; margin-left: 10px;" @click="shouyilog = true">修改</div>
                    <div v-if="!form.expect_income_change_at" style="color: #409eff; margin-left: 10px;"  @click="shouyilog = true">定时生效</div>
                  </div>
                </el-form-item>

                <el-dialog title="结算规则定时生效" :visible.sync="shouyilog" width="480px"  :close-on-click-modal="false" :close-on-press-escape="false">
                    <div>
                      <el-input v-model="form.change_expect_income" placeholder="修改后的预估收益"></el-input>
                    </div>
                    <div>
                      <el-date-picker type="datetime" v-model="form.expect_income_change_at" size="medium" value-format="yyyy-MM-dd HH:mm:ss" style="margin-bottom: 20px; width: 100%; margin-top: 20px;" placeholder="预估收益定时时间"></el-date-picker>
                    </div>
                    <span slot="footer" class="dialog-footer">
                      <el-button @click="shouyiqingchu">清除设置</el-button>
                      <el-button type="primary" @click="shouyilog = false">确 定</el-button>
                    </span>
                </el-dialog>
                <!-- //新 -->

								<!-- <el-form-item label="物流公司:">
                                    <el-select v-model="form.track" placeholder="物流公司:">
                                      <el-option v-for="item in form.tracklist" :key="item.id" :label="item.company" :value="item.id"></el-option>
                                    </el-select>
                                </el-form-item> -->
							</el-form>
						</div>
					</div>

					<div class="step" v-if="!showmoney">
						<div class="tilte">关联号池设置</div>
						<div class="con haochi">
							<el-form ref="form" @submit.native.prevent :model="form" label-width="80px">
								<el-form-item>
									<!-- <div class="flex" style="margin-bottom: 30px;">
										<el-radio v-model="form.pool" label="1">关联号库（提供选号）</el-radio>
										<el-select v-model="form.pool_id" placeholder="请选择号库:">
											<el-option v-for="item in form.poollist" :key="item.id" :label="item.name"
												:value="item.id"></el-option>
										</el-select>
									</div>
									<div class="flex">
										<el-radio v-model="form.pool" label="2">无（不提供选号）</el-radio>
									</div> -->

									<div class="flex" style="margin-bottom: 30px;">
									    <el-radio v-model="form.pool" label="1">关联号库（提供选号）</el-radio>
									    <el-select v-model="form.pool_id" placeholder="请选择分销商:">
									      <el-option v-for="item in form.poollist" :key="item.id" :label="item.name" :value="item.id"></el-option>
									    </el-select>

									    <div style="margin-left: 30px;">开放范围:</div>
									    <el-select v-model="form.pool_use_rang" placeholder="请选择:">
									      <el-option label="仅自己销售可用" :value="1"></el-option>
									      <el-option label="所有分销商可用" :value="2"></el-option>
									    </el-select>
									</div>
                  <div class="flex">
                  	<el-radio v-model="form.pool" label="2">无（不提供选号）</el-radio>
                  </div>

                  <!-- <div class="flex">
                  	<div>电商平台号池关联</div>
                    <div style="margin-left: 20px;">
                      <div style="margin-left: 20px; margin-bottom: 10px;" v-for="item in form.ds_pool" :key="index" >号池ID:{{item.up_pool_id}} <span style="color: rgb(0, 74, 255); margin-left: 20px;" @click="shanchutianmao(index)">删除</span></div>
                      <div style="margin-bottom: 20px;"><el-button type="primary" plain @click="tianjiahaoku()">+添加天猫平台号池</el-button></div>
                      <div style="font-size: 12px; color: rgb(120, 125, 133);">关联后天猫号池可以从该产品的接口号池或关联号池中取号，优先走关联号库，如果您的分销商也需要天猫选号，您可以把他的号池关联至此处。</div>
                    </div>
                  </div> -->


								</el-form-item>
							</el-form>
						</div>
					</div>
					<div class="step" style="text-align: center;  padding-bottom: 50px;">
						<el-button v-if="!allshow" type="danger" @click="productsave(100)">确定发布基础产品</el-button>
						<el-button v-if="allshow" type="danger" @click="productsave(100)">下一步</el-button>
					</div>
					<div class="step" v-if="showmoney" style="text-align: center;   padding-bottom: 50px;">
						<el-button type="danger" @click="bangding()">发布商品</el-button>
					</div>
				</div>
			</div>
		</div>
		<el-dialog title="关键词设置" :visible.sync="keylog" width="700px;">
      <div style="background: rgb(217, 230, 244); color: rgb(57, 57, 57); padding: 10px 20px; border-radius: 2px; margin:0 0 20px;">
        检测机制：您输入的关键词会与用户的收货地址进行匹配，用户的收货地址中包含该关键词则视为敏感地区不发货，
        匹配中的订单会在生产发货——订单审核——敏感地区中等待人工审核，如果您觉得无需人工审核可以在人工审核页面设置。
      </div>
      <div class="kflex">
        <upload-excel-component @on-selected-file="exportData" round plain buttonName="导入" class="nobtn"></upload-excel-component>
        <el-button type="text" style="margin-right: 20px;" @click="xiazai">下载模板</el-button>
        <!-- <el-button type="primary" style="margin-right: 20px;" round plain @click="qingchu">导出当前不发货区域</el-button> -->
        <el-button type="primary" round plain @click="qingchu">清空所有不发货区域</el-button>
      </div>
			<!-- <div style="display: flex; justify-content: space-between;">
				<div style="flex-basis: 370px; line-height: 30px;">
					<div>关键词尽量采用：地市名称和区域名称，确保系统精准检查</div>
					<div>例：河南开封市尉氏县蔡庄镇 关键词：开封市，蔡庄镇</div>
				</div>
				<div class="keyd" style="flex-basis: 220px; flex-wrap: wrap;">
					<upload-excel-component @on-selected-file="exportData" buttonName="导入" class="nobtn">
					</upload-excel-component>
					<el-button type="primary" style="margin-bottom: 20px;" size="mini" plain @click="xiazai">下载模板
					</el-button>
					<el-button type="primary" style="margin-left: 0px; margin-top: 10px;" size="mini" @click="qingchu">
						一键清除</el-button>
				</div>
			</div> -->
			<div>
				<div style="display: flex; background: #E5E5E5; color: #707070; text-align: center; line-height: 45px; margin-top: 20px;">
          <div style="flex: 1;">敏感地区关键词</div>
					<div style="flex: 1;">关键词对应的原敏感地区
            <el-tooltip class="item" effect="light" :tabindex="20000" content="原敏感地区是运营商给的不发货地区，会用于人工再次判断是否敏感" placement="top">
            	<i class="el-icon-question" style="color: #409EFF; font-size: 18px;"></i>
            </el-tooltip>
          </div>

				</div>
				<div class="keylist" style="max-height: 350px; overflow: auto;">
					<div style="display: flex; border: 1px #EAEAEA solid;" v-for="(item,i) in keyv" :key="i">

						<div style="flex: 1; display: flex; padding:10px;">
							<el-input v-model="item.key2" style=" margin-right: 10px;" placeholder="请输入内容"></el-input>
							<el-input v-model="item.key3" placeholder="请输入内容"></el-input>

						</div>
            <div style="flex: 1; padding:10px; display: flex;">
            	<el-input v-model="item.key1" placeholder="请输入内容"></el-input>

              <i class="el-icon-delete" @click="keydel(i)"
              	style=" margin-left: 5px; padding-top: 8px; cursor: pointer;"></i>
            </div>
					</div>
				</div>
				<div style="display: flex; justify-content: center; margin-top: 20px;">
					<el-button type="primary"  @click="addkey">新增关键词</el-button>
				</div>

			</div>
			<span slot="footer" class="dialog-footer">
				<el-button @click="keylog = false">取 消</el-button>
				<el-button type="primary" @click="keygo">确 定</el-button>
			</span>
		</el-dialog>

		<el-dialog title="自定义产品类型" :visible.sync="taglog" width="400px">
			<div class="protag">
				<el-tag :key="item.id" v-for="item in typelist"  :disable-transitions="false"
					@close="handleClose(item.name)">{{item.name}}</el-tag>
				<el-input class="input-new-tag" v-if="inputVisible" v-model="inputValue" ref="saveTagInput"
					@keyup.enter.native="handleInputConfirm" @blur="handleInputConfirm">
				</el-input>
				<el-button v-else class="button-new-tag"  @click="showInput">输入自定义名称</el-button>
			</div>
			<span slot="footer" class="dialog-footer">
				<el-button @click="taglog = false">取 消</el-button>
				<el-button type="primary" @click="taglog = false">确 定</el-button>
			</span>
		</el-dialog>

    <el-dialog title="对接电商号库" :visible.sync="tianmaolog" width="400px">
    	<div class="protag">
    		<el-input class="input-new-tag"v-model="tianmaoall.up_pool_id" placeholder="请输入天猫号库ID"></el-input>
    	</div>
      <div class="kflexc" style="color: #409EFF; margin-top: 10px;" @click="tianmaolog2 = true">
        点击查看获取方式
      </div>
    	<span slot="footer" class="dialog-footer">
    		<el-button @click="tianmaolog = false">取 消</el-button>
    		<el-button type="primary" @click="tianmaogo">确 定</el-button>
    	</span>
    </el-dialog>
    <el-dialog title="获取方式" :visible.sync="tianmaolog2" width="600px">
    	<img src="https://file.storep.91haoka.cn/gantanhao/tianmaohaoku3.png" style="max-width: 100%;">
      <img src="https://file.storep.91haoka.cn/gantanhao/tianmaohaoku.png" style="max-width: 100%;">
    	<span slot="footer" class="dialog-footer">
    		<el-button type="primary" @click="tianmaolog2 = false">确 定</el-button>
    	</span>
    </el-dialog>



		<!-- <foot></foot> -->
<el-dialog
			class="t_idcardshow"
			title="设置不发货前4位身份证号或者6位"
			:visible.sync="isidcardshow"
			width="1000px">
			<div style="margin-top: 17px;font-size: 13px;background-color: #D9E6F4;padding: 15px 25px;margin-bottom: 20px;">
				系统会根据身份证号前4位或者前6位进行对比，对比成功则直接开卡失败，失败原因：风控身份证号前四位或者前六位
			</div>
			<div style="display: flex;">
				<upload-excel-component @on-selected-file="exportDataID" buttonName="导入证件号" class="nobtn">
				</upload-excel-component>
				<el-button type="text" style="margin-bottom: 20px;margin-left: 20px;"  plain @click="xiazai3">下载模板
				</el-button>
			</div>
			<el-table
				:data="tags"
				border
				style="width: 100%">
				<el-table-column	align="center" label="不发货的身份证号前4位或者前6位"	prop="name">
          <template slot-scope="scope">
            <el-input v-model="scope.row.name" maxlength="6" size="small" style="width: 150px;" placeholder="请输入身份证号前4位或者前6位"></el-input>
          </template>
        </el-table-column>

				<el-table-column label="操作" align="center">
					<template slot-scope="scope">
						<el-button
						size="mini"
						type="danger"
						@click="tagClose(scope.row)">删除</el-button>
					</template>
				</el-table-column>
			</el-table>
			<!-- <div>
				<el-tag
					style="margin-right: 10px;
					margin-bottom: 10px;"
					v-for="tag in tags"
					:key="tag.name"
					size="small"
					closable
					@close="tagClose(tag)"
					type="">
					{{tag.name}}
				</el-tag>
			</div> -->
			<div  style="margin-bottom:17px;font-size: 16px;margin-top: 40px;">
				<!-- <el-button @click="showaddinput=true" type="primary" plain><i class="el-icon-plus"></i>增加号码</el-button> -->
        <el-button @click="xinzengshenfenzhenghao" type="primary" plain><i class="el-icon-plus"></i>增加号码</el-button>
			</div>
			<div v-if="showaddinput">
				<el-input v-model="addtaginput" size="small" type="number" style="width: 150px;" placeholder="请输入号码"></el-input>
				<el-button type="primary" size="small" @click="addtag" plain>增加</el-button>
			</div>

			<div style="text-align: center;">
				<el-button type="danger" round  @click="sureaddtag" >确定</el-button>
				<el-button type="info" round  @click="isidcardshow=false" >取消</el-button>
			</div>
		</el-dialog>
	</div>
</template>

<script>
  import chanpindiqutongbu from './chanpindiqutongbu/chanpindiqutongbu.vue'
	import {
    provinceAndCityDataPlus,
		provinceAndCityData,
		CodeToText,
		TextToCode
	} from 'element-china-area-data'
	import UploadExcelComponent from "@/components/UploadExcel/index.vue";
	import E from 'wangeditor'
	import axios from 'axios'
	import top from '@/components/top.vue'
	import left from '@/components/left.vue'
	import foot from '@/components/foot.vue'
	export default {
		components: {
			"left": left,
			"top": top,
			"foot": foot,
			UploadExcelComponent,chanpindiqutongbu
		},
		name: 'addBasis',
		data() {
			return {
				product_services: [],
				shoufei1: false,
				shoufei2: false,
				shoufei3: false,
				shoufei4: false,
				keylog: false,
				keyv: [{
					"key1": "",
					"key2": "",
					"key3": ""
				}],

				taglog: false,
				taglist: ['类型1', '类型2'],
				inputVisible: false,
				inputValue: '',

				mingan: {
					city: "",
					citys: [],
					fixcitys: []
				},
				randomnum: "",
				jingdongrandom: "",
				search: "",
				msg: "hello",
				log: false,
				loading: false,

				typelist: {},

				rules: {
				 operator: [{
						required: true,
						message: '请选择运营商',
						trigger: 'change'
					}],
					name: [{
						required: true,
						message: '必填',
						trigger: 'blur'
					}],
					sku: [{
						required: true,
						message: '必填',
						trigger: 'blur'
					}],
					// address_city: [{
					// 	required: true,
					// 	message: '请选择归属地',
					// 	trigger: 'change'
					// }],
					real_name_type: [{
						required: true,
						message: '请输入',
						trigger: 'change'
					}],
					randomnum: [{
						required: true,
						message: '请输入抓单码',
						trigger: 'change'
					}],
					// title: [{ required: true, message: '必填', trigger: 'change' }],
					is_need_photo: [{
						required: true,
						message: '必选',
						trigger: 'change'
					}],
					img: [{
						required: true,
						message: '必选',
						trigger: 'change'
					}],
					edit: [{
						required: true,
						message: '必填',
						trigger: 'change'
					}],
					visible: [{
						required: true,
						message: '必选',
						trigger: 'change'
					}],
					commission: [{
						required: true,
						message: '必填',
						trigger: 'change'
					}]
				},
				form: {
					product_source: "",
					warn_area_type: "1",
					deliver_province: "",
					tracklist: "",
					track: "",
					poollist: "",
					pool: "2",
					pool_id: "",
					pool_use_rang:"",
					produce_address: "",
					operator: 10099,
					name: "",
					sku: "",
					plan_type_id: "",
					province: "",
					city: [],
					real_name_type: '0',
					real_name_type2: '0',
					produce_remark: "",
					status: "",
					comname: "",
					min_age: "",
					max_age: "",
					max_purchase: "-1",
					need_num: "1",
					haochinum: 1,
					haochival: 1,

					address_province: "",
					address_city: "",
					address_district: "",
					commission_rule: "",

          commission_rule_change_at:"", //结算规则 修改时间   例 2024-06-28 16:46:00
          change_commission_rule:"", // 结算规则定时修改的内容 字符串
          expect_income:"", //  预估收益 小数点后两位
          expect_income_change_at:"", // 预估收益定时时间 例 2024-06-28 16:46:00
          change_expect_income:"", // 修改后的预估收益 小数点后两位

					is_identify_id:0,
					id_identify:[],
          ds_pool:[]
				},
				shopform: {
					product_id: "",
					title: "",
					status: "",
					parent_id: "",
					selling_point: "",
					commission_rule: "",
					is_need_photo: '0',
					description: "",
					image1: "",
					imageUrl: '',
					imageUrl2: '',
				},
				moneyform: {
					order_page_id: "",
					visible: '1',
					commission: "",
					child_shop_ids: "",
					dislist: "",
					money: "",
					list: ""
				},
				kejian: false,
				sub1: true,
				sub2: true,
				sub3: false,
				sub4: true,
				showmoney: false,
				sanlist: [
     //      {
					// 	name: "中国联通",
					// 	id: 10010
					// },
					// {
					// 	name: "中国移动",
					// 	id: 10086
					// },
					// {
					// 	name: "中国电信",
					// 	id: 10000
					// },
					{name:"中国广电",id:10099},
					// {
					// 	name: "虚拟运营商",
					// 	id: 11111
					// }
				],
				url: "",
				randomvalue: "",
				randomone: false,
				randomlog: false,
				shop_id: "",

				xiaomingtime: "",
				xiaomingying: "",
				fx: true,
				fxs: {
					id: "",
					id_card: "",
					id_card_range: "",
					address_mobile: "",
					address_mobile_range: "",
					address: "",
					address_range: "",
					type: 0,
					status: "",
					sitaddress: "0",
					sitmobile: "0",

          sitidcardnum: "0",
          id_card_num: "",
          id_card_num_range: ""
				},
				fxsid: "",
				fxloading: true,
				allshow: false,
				stock: "",
				is_stock: "0",
				kucuninp: false,
				warn_stock: "",
				white_list: true,
				isidcardshow:false,
				tags: [],
				tagssure:[],
				addtaginput:'',
				showaddinput:false,
				tianmaolog:false,
				tianmaoall:{
					source:"",
					up_pool_id:""
				},
				tianmaolog2:false,
        qudaolists:[],
        relo:true
			}
		},
		created() {

      this.citylist = JSON.parse(JSON.stringify(provinceAndCityData))
      this.citylist.unshift({
        label: "全国归属地随机",
        value: "99999",
        children: []
      })
      this.citylist.unshift({
        label: "全国归属地",
        value: "99998",
        children: []
      })

			//地址配置,用于下载模板
			if (window.location.href.indexOf("91haoka_platform") > -1) {
				console.log("线上项目，谨慎操作。")
				this.url = window.location.origin + "/91haoka_platform/"
			} else {
				this.url = ""
			}
			//小鸣莺家用
			var xiaomingying = JSON.parse(localStorage.getItem('USER'));
			this.xiaomingying = xiaomingying.id

			//获取快递公司
			this.gettracklist()
			//号池
			this.getlists()
			//获取分销商
			this.getdislist()
			//获取类型
			this.getproductstype();

			//随机生成10位数
			axios.get('/api/sys/str-random')
				.then(response => {
					if (response.data.msg.code == 0) {
						this.randomnum = response.data.data
					} else {
						this.$message.error(response.data.msg.info);
					}

				})

			axios.get('/api/gth/user/shop')
				.then(response => {
					if (response.data.msg.code == 0) {
						this.shop_id = response.data.data.shop_id
					} else {
						if (response.data.msg.code == 50401) {
							that.$router.push({
								path: "/login"
							});
							return false
						}
						that.$message.error(response.data.msg.info);
					}
				})

			this.getfx()
			//发布完整产品商品
			if (this.$route.query.allshow == 'allshow') {
				this.allshow = true
			}

      //获取运营商渠道
      axios.get('/api/plan-market/product/sources?page_size=2000')
        .then(response => {
          if (response.data.msg.code == 0) {
             this.qudaolists = response.data.data
          } else {
             this.$message.error(response.data.msg.info);
          }
      })
		},
		methods: {
      yinyongall:function(item){
        this.form.deliver_province = item.deliver_province
        this.mingan.fixcitys = item.warn_city
        this.mingan.citys = item.warn_province
        this.form.warn_area_type = item.warn_area_type.toString()
      },
      shuaxin:function(){
        this.relo = false
        this.$nextTick(()=>{
          this.relo = true
          this.$nextTick(()=>{
            this.$refs.chanpindiqutongbu.log = true
          })
        })
      },

      shanchutianmao:function(index){

        this.form.ds_pool.splice(index,1)
      },
      tianmaogo:function(){
        console.log(1)
        this.form.ds_pool.push(this.tianmaoall)
        this.tianmaolog = false
      },
      //打开添加天猫号库
      tianjiahaoku:function(){
        this.tianmaoall = {
          'source':'tmall',
          'up_pool_id':''
        }
        this.tianmaolog = true
      },
			//收费项目选择
			shoufeichange: function() {
				if (this.shoufei1 == true) {
					if (this.product_services.indexOf(1) == -1) {
						this.product_services.push(1)
					}
				} else {
					if (this.form.product_services.indexOf(1) > -1) {
						this.form.product_services.splice(this.form.product_services.findIndex(item => item.id === 1),
							1)
					}
				}
				if (this.shoufei2 == true) {
					if (this.product_services.indexOf(2) == -1) {
						this.product_services.push(2)
					}
				} else {
					if (this.form.product_services.indexOf(2) > -1) {
						this.form.product_services.splice(this.form.product_services.findIndex(item => item.id === 2),
							1)
					}
				}
				if (this.shoufei3 == true) {
					if (this.product_services.indexOf(3) == -1) {
						this.product_services.push(3)
					}
				} else {
					if (this.form.product_services.indexOf(3) > -1) {
						this.form.product_services.splice(this.form.product_services.findIndex(item => item.id === 3),
							1)
					}
				}

			},
			//库存选择与显示
			changekucun: function() {
				if (this.is_stock == 1) {
					this.kucuninp = true
				} else {
					this.kucuninp = false
					this.stock = ""
					this.warn_stock = ""
				}
			},
			//更换默认和自定义
			changetype: function(type) {
				this.fxs.type = type
				this.fxloading = true
				this.getfx()
			},
			//更新风险全局方案
			fixfx: function() {
				var that = this;
				var sj = {
					service_id: this.fxs.id,
					id_card: this.fxs.id_card,
					id_card_range: this.fxs.id_card_range,
					address_mobile: this.fxs.address_mobile,
					address_mobile_range: this.fxs.address_mobile_range,
					address: this.fxs.address,
					address_range: this.fxs.address_range,
					type: this.fxs.type,
					status: this.fxs.status,
					sitaddress: this.fxs.sitaddress,
          sitidcardnum: this.fxs.sitidcardnum,
          id_card_num: this.fxs.id_card_num,
          id_card_num_range: this.fxs.id_card_num_range,
					sitmobile: this.fxs.sitmobile,
				}
				axios.post('/api/plan-market/service/update', sj)
					.then(response => {
						if (response.data.msg.code == 0) {
							that.$message({
								message: '保存成功',
								type: 'success'
							});
							that.fx = true
						} else {
							that.$message.error(response.data.msg.info);
						}
					})
			},
			//保存风险全局方案
			savefx: function() {
				var that = this;
				var sj = {
					id_card: this.fxs.id_card,
					id_card_range: this.fxs.id_card_range,
					address_mobile: this.fxs.address_mobile,
					address_mobile_range: this.fxs.address_mobile_range,
					address: this.fxs.address,
					address_range: this.fxs.address_range,
					type: this.fxs.type,
					status: this.fxs.status,
					sitaddress: this.fxs.sitaddress,
          sitidcardnum: this.fxs.sitidcardnum,
          id_card_num: this.fxs.id_card_num,
          id_card_num_range: this.fxs.id_card_num_range,
					sitmobile: this.fxs.sitmobile,
				}
				axios.post('/api/plan-market/service/create', sj)
					.then(response => {
						if (response.data.msg.code == 0) {
							that.$message({
								message: '保存成功',
								type: 'success'
							});
							that.fxs = response.data.data
							if (that.fxs.type == 1) {
								that.fxsid = response.data.data.id
							}
              this.fx = true
						} else {
							that.$message.error(response.data.msg.info);
						}
					})
			},
			//获取风险全局方案
			getfx: function() {
				var that = this;
				if (this.fxs.type == 0) {
					this.fx = true
					axios.get('/api/plan-market/service/index?type=0')
						.then(response => {
							if (response.data.msg.code == 0) {
								if (response.data.data == null) {
									this.fxs = {
										id: "",
										id_card: "",
										id_card_range: '9999',
										address_mobile: "",
										address_mobile_range: '9999',
										address: "",
										address_range: '9999',
										type: 0,
										status: "",
										sitaddress: '0',
                    sitidcardnum: '0',
                    id_card_num: "",
                    id_card_num_range: '9999',
										sitmobile: '0',
									}
								} else {
									this.fxs = response.data.data
								}
							} else {
								that.$message.error(response.data.msg.info);
							}
							this.fxloading = false
						})
				} else {
					this.fx = false
					axios.get('/api/plan-market/service/index?type=1&service_id=' + this.fxsid)
						.then(response => {
							if (response.data.msg.code == 0) {
								if (response.data.data == null) {
									this.fxs = {
										id: "",
										id_card: "",
										id_card_range: '9999',
										address_mobile: "",
										address_mobile_range: '9999',
										address: "",
										address_range: '9999',
										type: 1,
										status: "",
										sitaddress: '0',
                    sitidcardnum: '0',
                    id_card_num: "",
                    id_card_num_range: '9999',
										sitmobile: '0',
									}
								} else {
									this.fxs = response.data.data
								}
							} else {
								that.$message.error(response.data.msg.info);
							}
							this.fxloading = false
						})
				}

			},
			//手动添加关键词
			keygo: function() {
				this.mingan.citys = []
				this.mingan.fixcitys = []
				for (var i in this.keyv) {
					if (this.keyv[i].key1 != "" && this.keyv[i].key2 != "" && this.keyv[i].key3 != "") {
						this.mingan.citys.push(this.keyv[i].key1)
						var k2 = this.keyv[i].key2
						var k3 = this.keyv[i].key3
						var obj = {}
						obj[k2] = k3
						this.mingan.fixcitys.push(obj)
					}
				}
				this.keylog = false
			},
			//删除关键词
			keydel: function(i) {
				this.keyv.splice(i, 1);
			},
			//增加关键词
			addkey: function() {
				this.keyv.push({
					"key1": "",
					"key2": "",
					"key3": ""
				})
			},
			//获取快递公司
			gettracklist: function() {
				var that = this
				axios.get('/api/plan-market/logistics-companies')
					.then(response => {
						that.form.tracklist = response.data.data
					})
			},
			//获取号池
			getlists: function() {
				var that = this
				axios.get('/api/plan-market/pool/list?page=1&page_size=1000&status=1')
					.then(response => {
						that.form.poollist = response.data.data.data
					})
			},
			//搜索功能
			searchgo: function() {
				this.loading = true
				this.getmoneylist();
			},

			//下载
			xiazai: function() {
				const a = document.createElement('a');
				a.setAttribute('download', '敏感地区模板.xlsx');
				a.setAttribute('href', this.url + 'static/mingandiqu.xlsx');
				a.click();
			},
			//下载
			xiazai2: function() {
				const a = document.createElement('a');
				a.setAttribute('download', '导入证件号.xlsx');
				a.setAttribute('href', this.url + 'static/daoruzjh.xlsx');
				a.click();
			},
			//产品名验证唯一性
			nijiushiwodeweiyi1: function() {
				var that = this;
				axios.get('/api/plan-market/product/name/isexist?name=' + that.form.name)
					.then(response => {
						if (response.data.msg.code == 0) {
							this.sub1 = true
						} else {
							this.sub1 = false
							that.$message.error(response.data.msg.info);
						}
					})
			},

			//产品编号验证唯一性
			nijiushiwodeweiyi2: function() {
				var that = this;
				axios.get('/api/plan-market/product/sku/isexist?sku=' + this.form.sku)
					.then(response => {
						if (response.data.msg.code == 0) {
							this.sub2 = true
						} else {
							this.sub2 = false
							that.$message.error(response.data.msg.info);
						}
					})
			},

			//身份证审核
			cardid: function() {
				this.moneyform.child_shop_ids = "";
				if (this.moneyform.visible == 3 || this.moneyform.visible == 4) {
					this.kejian = true
				}
				if (this.moneyform.visible == 1 || this.moneyform.visible == 2) {
					this.kejian = false
				}
			},
			//获取全部分销商
			getdislist: function() {
				var that = this;
				axios.get('/api/gth/partner/list?page_size=10000')
					.then(response => {
						if (response.data.msg.code == 0) {
							that.moneyform.dislist = response.data.data.data
						} else {
							that.$message.error(response.data.msg.info);
						}
					})
			},
			//保存产品
			productsave: function(status) {
        if(JSON.parse(localStorage.getItem('SHOP')).shop_id == 50481 || JSON.parse(localStorage.getItem('SHOP')).shop_id == 304676 ){
          if(this.form.product_source == ''){
            this.$message.error('请填写所属渠道');
            return false
          }
        }

        // if(!this.fxs.id){
        //   this.$message.error('请选择或者填写风控选项，如果是第一次发布产品，请配置风险预警设置');
        //   return false
        // }
				if (this.sub1 == false || this.sub2 == false || this.sub4 == false || this.form.name == "" || this.form
					.sku == "") {
            this.$message.error('请填写必填信息');
					return false
				}
				//发布还是仅保存
				this.form.status = status
				this.shopform.status = status
				let white_list
				if (this.white_list == true) {
					white_list = 0
				} else {
					white_list = 1
				}
				//身份证号码数组
				var id_identify = []
				for(var x = 0;x<this.tagssure.length;x++){
					id_identify.push(this.tagssure[x].name)
				}

				var that = this;
				var formData = {
					product_source: this.form.product_source,
					warn_area_type: this.form.warn_area_type,
					deliver_province: this.form.deliver_province,
					white_list: white_list,
					name: this.form.name,
					sku: this.form.sku,
					operator: this.form.operator,
					plan_type_id: this.form.plan_type_id,
					province: this.form.address_province,
					city: this.form.address_city,
					real_name_type: this.form.real_name_type,
					produce_remark: this.form.produce_remark,
					max_purchase: this.form.max_purchase,
					min_age: this.form.min_age,
					max_age: this.form.max_age,
					status: this.form.status,
					produce_address: this.form.produce_address,
					commission_rule: this.form.commission_rule,

          commission_rule_change_at:"", //结算规则 修改时间   例 2024-06-28 16:46:00
          change_commission_rule:"", // 结算规则定时修改的内容 字符串
          expect_income:"", //  预估收益 小数点后两位
          expect_income_change_at:"", // 预估收益定时时间 例 2024-06-28 16:46:00
          change_expect_income:"", // 修改后的预估收益 小数点后两位

					warn_province: this.mingan.citys,
					warn_city: this.mingan.fixcitys,
					tracking_company_id: this.form.track,
					need_num: this.form.need_num,
					max_purchase_time: this.xiaomingtime,
					service_id: this.fxs.id,
					is_stock: this.is_stock,
					stock: this.stock,
					warn_stock: this.warn_stock,
					product_services: this.product_services,
					is_identify_id:this.form.is_identify_id,
					id_identify:id_identify,
          is_force_recharge:this.form.is_force_recharge,
          pool_use_rang:this.form.pool_use_rang,
          ds_pool:this.form.ds_pool

				}

				if (this.form.pool == 1) {
					formData.pool_id = this.form.pool_id
				}
				axios.post('/api/gth/products/release', formData)
					.then(response => {
						if (response.data.msg.code == 0) {
							if (that.allshow == true) {
								that.$router.push({
									path: '/productionDelivery/addShop?allshow=allshow&id=' + response.data.data.id
								})
							} else {
								that.$message({
									message: '发布成功！',
									type: 'success'
								});
								that.$router.push({
									path: '/productionBasismanag'
								})
							}

						} else {
							that.$message.error(response.data.msg.info);
						}
					})
			},


			//选择省市区
			changeaddress:function(v){

			  if(v[0] == '99999'){
			    this.form.address_province = '全国归属地随机'
			    this.form.address_city = ""
			  }
			  else if(v[0] == '99998'){
			    this.form.address_province = '全国归属地'
			    this.form.address_city = ""
			  }
			  else{
			    this.form.address_province = CodeToText[v[0]]
			    this.form.address_city = CodeToText[v[1]]
			  }


			},
			qingchu: function() {
				this.mingan.fixcitys = []
				this.keyv = [{
					"key1": "",
					"key2": "",
					"key3": ""
				}]
			},
			//导入敏感地区
			exportData: function(data) {

				this.mingan.citys = []
				this.mingan.fixcitys = []
				for (var i = 0; i < data.results.length; i++) {

					this.mingan.citys.push(data.results[i]['敏感地区'].trim())

					if (data.results[i]['修改敏感地区'].indexOf(",") > -1) {
						var arr = data.results[i]['修改敏感地区'].split(',')
					} else if (data.results[i]['修改敏感地区'].indexOf("，") > -1) {
						var arr = data.results[i]['修改敏感地区'].split('，')
					} else {
						return false
						that.$message.error("数据出错了，请检查格式");
					}
					var obj = {}
					obj[arr[0]] = arr[1]
					this.mingan.fixcitys.push(obj)

					var obj2 = {}
					obj2['key1'] = data.results[i]['敏感地区']
					obj2['key2'] = arr[0]
					obj2['key3'] = arr[1]

					this.keyv.push(obj2)
				}
				this.$message({
					message: '导入成功，共计' + this.mingan.citys.length + '条',
					type: 'success'
				});
			},
			//导入身份证号
			exportDataID: function(data) {

				console.log(data.results)

				for (var i = 0; i < data.results.length; i++) {
					this.tags.push({'name':data.results[i]['不发货的身份证号前4位']})
				}

			},

			//获取产品类型
			getproductstype: function() {
				var that = this
				axios.get("/api/gth/plan-type")
					.then(function(response) {
						if (response.data.msg.code == 0) {
							that.typelist = response.data.data
						} else {
							that.$message.error(response.data.msg.info);
						}

					})
			},

			//自定义产品类型
			handleClose(tag) {
				this.taglist.splice(this.taglist.indexOf(tag), 1);
			},

			showInput() {
				this.inputVisible = true;
				this.$nextTick(_ => {
					this.$refs.saveTagInput.$refs.input.focus();
				});
			},

			handleInputConfirm() {
				var that = this;
				var formData = new FormData();
				formData.append("name", this.inputValue);
				axios.post('/api/gth/plan-type/release', formData)
					.then(response => {
						if (response.data.msg.code == 0) {
							that.getproductstype();
							that.$message({
								message: '添加成功',
								type: 'success'
							});
						} else {
							that.$message.error(response.data.msg.info);
						}
					})
				let inputValue = this.inputValue;
				if (inputValue) {
					this.taglist.push(inputValue);
				}
				this.inputVisible = false;
				this.inputValue = '';
			},
			idcardshow(){
				this.tags = JSON.parse(JSON.stringify(this.tagssure))
				this.isidcardshow = true
			},
			tagClose(tag) {
				this.tags.splice(this.tags.indexOf(tag), 1);
			},
      xinzengshenfenzhenghao:function(){
        this.tags.push({'name':""})
      },
			addtag(){
				if(this.addtaginput!=''&&this.addtaginput.length==4){
					this.tags.push({'name':this.addtaginput})
					this.addtaginput = ''
				}else{
					this.$message.error('请输入身份证号前4位');
				}
			},
			sureaddtag(){
				this.tagssure = JSON.parse(JSON.stringify(this.tags))
				this.isidcardshow = false
			}
		}

	}
</script>
<style scoped>
/deep/.t_idcardshow .el-dialog__body{
	padding-top: 0;
}
/deep/.nobtn .el-button--primary{
	background-color:#EEF7FF;
	border-color: #0C83FF;
	color:#0C83FF;
	border-radius: 20px;
}
</style>
<style lang="scss" scoped>
	/deep/ .w-e-menu{ z-index: 1001 !important;}
	/deep/ .w-e-text-container{z-index: 1000 !important; }
  /deep/ .el-tooltip__popper.is-light{ z-index: 29999 !important;}
  .nobtn /deep/ .el-button--primary{
        margin-right: 20px;
        border-radius: 20px;
        color: #409EFF;
        background: #ecf5ff;
        border-color: #b3d8ff;
  }
	.index {
    /deep/ .is-process{ color:#C0C4CC; border-color:#C0C4CC;}
		.zengzhi {
			color: #FF3B3B;
			margin-left: 10px;

			/deep/ .el-checkbox {
				margin-right: 0;
			}


			i {
				font-size: 20px;
				margin-left: 0px !important;
				margin-right: 10px;
			}

			a {
				color: #1989FA;
			}
		}

		.xiaoming {
			display: flex;

			.el-form-item {

			}

		}

		.san {
			.el-input {

			}
		}

		.ts {
			text-align: center;
			font-size: 14px;
			color: #666;
		}

		.add {
			text-align: right;
			position: relative;

			.input-with-select {

			}

			.el-button {
				position: absolute;
				right: 0px;
				top: 0px;
			}
		}

		}

		.loglist {
			display: flex;
			justify-content: space-between;
			margin-bottom: 30px;

			.log_title {
				padding: 7px 10px;
			}
		}

		.listl {
			height: 350px;
			overflow: auto;

			.el-input__inner {
				border: none;
				text-align: center
			}
		}

		.list {

			display: flex;
			text-align: center;
			color: #727272;
			line-height: 45px;
			border: 1px #EAEAEA solid;
			margin-top: -1px;

			.th {
				flex: 1;
				background: #F9F9F9;
				font-size: 14px;
			}

			.td {
				flex: 1;
				font-size: 14px;
				border-right: 1px #EAEAEA solid;
			}
		}

		.el-pagination {
			text-align: right;
			margin: 20px 0
		}

		// .el-dialog__wrapper {
		// 	z-index: 19999 !important;
		// }

		.keyd {
			display: flex;

			.is-plain {
				height: 30px;
				line-height: 30px;
				padding: 0 10px;
				margin-left: 10px;
			}

			#drop {
				.el-button--primary {
					background: #409EFF;
					border: 1px #409eff solid;
					height: 30px;
					line-height: 30px;
					padding: 0 20px;
				}
			}
		}

		.protag {
			.el-tag {
				margin-right: 20px;
				margin-bottom: 20px;
			}
		}

		.index {

			.kucunset {
				width: 300px;
			}

			.kucuninp {
				margin-left: 10px;
				margin-top: 2px;
			}

			/deep/ .el-steps {
				padding: 30px 0;
			}

			/deep/ .el-step__title {
				text-align: center;
				padding: 0;
			}

			/deep/ .el-step__description {
				text-align: center;
				padding: 0;
			}

			.ts {
				padding: 20px 0;
			}

			.step {
				background: #FFFFFF;

				/deep/ .el-step__icon {
					width: 36px;
					height: 36px;
				}

				/deep/ .el-step__line {
					top: 17px;
				}

				.is-process {
					color: #C0C4CC;
					border-color: #C0C4CC;
					font-weight: 400
				}

				.redbor {
					/deep/ .el-input__inner {
						border: 1px #EEF7FF solid;
					}
				}

				.tilte {
					background: #F9F9F9;
					padding-left: 30px;
					line-height: 45px;
					font-size: 14px;

					i {
						font-size: 25px;
						color: #B1E4FF;
						float: right;
						margin-right: 20px;
						margin-top: 8px;
					}
				}

				.w330 {
					/deep/ .el-input__inner {
						width: 330px !important;
					}
				}

				.w480 {
					/deep/ .el-input__inner {
						width: 480px !important;
					}
				}

				.con {
					background: #FFFFFF;
					padding: 35px;

					.flex {
						display: flex;
					}

					.ori3 {
						i {
							font-size: 25px;
							color: #409EFF;
							position: relative;
							top: 3px;
							margin-left: 15px;
						}

					}

					.ori {
						background: #FBFBFB;
						padding: 20px 10px;
            /deep/ .el-form-item__label{ width: 150px !important;}
            /deep/ .el-form-item__content{ margin-left: 150px !important;}
						.fx {
							display: flex;
							position: relative;
							left: -10px;
							top: -20px;
							background: #FFFFFF;

							.fxli {
								flex-basis: 200px;
								text-align: center;
								border-top: 3px #FFFFFF solid;
								line-height: 40px;
								cursor: pointer;
							}

							.fxact {
								background: #FBFBFB;
								border-top: 3px #EEF7FF solid;
							}
						}

						.fxbtm {
							display: flex;
							padding-left: 50px;

							.red {
								margin-left: 20px;
								color: #FF3B3B;
							}
						}

						.hui {
							color: #999;
						}

						/deep/ .el-input {
							width: 300px;
						}

						/deep/ .el-form-item {
							margin-bottom: 20px;
						}

						/deep/ .el-form-item__label {

						}

						.age .el-input {

						}

						.wenhao2 {
							color: #999;
							font-size: 14px;
						}

						.no {
							display: flex;
							align-items: center;

							#drop {
								/deep/ .el-button--primary {
									background: #409EFF;
									border: 1px #409eff solid;
								}
							}

							.nonum {
								background: #409EFF;
								padding: 0px 10px;
								line-height: 35px;
								height: 35px;
								color: #FFFFFF;
								border-radius: 3px;
								display: block;
							}

							.el-button {}

							span {
								margin: 0 20px;
							}
						}

					}
				}

				.haochi {
					/deep/ .el-radio__label {
						line-height: 40px;
					}

					/deep/ .el-select {
						margin-left: 20px;
					}
				}

				.btm0 {
					/deep/ .el-button {
						margin-left: 20px;
					}

					/deep/ .el-form-item {
						margin-bottom: 0;
					}
				}

				.label200 .el-form-item__label {
					width: 180px !important;
				}

				.avatar-uploader .el-upload {
					border: 1px dashed #d9d9d9;
					border-radius: 6px;
					cursor: pointer;
					position: relative;
					overflow: hidden;
				}

				.avatar-uploader .el-upload:hover {
					border-color: #409EFF;
				}

				.avatar-uploader-icon {
					font-size: 28px;
					color: #8c939d;
					width: 178px;
					height: 178px;
					line-height: 178px;
					text-align: center;
				}

				.avatar {
					width: 178px;
					height: 178px;
					display: block;
				}

				.wenhao {
					background: #B1E4FF;
					color: #FFFFFF;
					line-height: 15px;
					cursor: pointer;
					padding: 5px 11px;
					margin-left: 20px;
					text-align: center;
					border-radius: 14px;
				}
			}


	}
</style>
